<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/smart_ptr/detail/shared_count.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/smart_ptr/detail</a> - shared_count.hpp<span style="font-size: 80%;"> (source / <a href="shared_count.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">23</td>
            <td class="headerCovTableEntry">34</td>
            <td class="headerCovTableEntryLo">67.6 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">27</td>
            <td class="headerCovTableEntry">152</td>
            <td class="headerCovTableEntryLo">17.8 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED</a>
<span class="lineNum">       2 </span>            : #define BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED
<span class="lineNum">       3 </span>            : 
<span class="lineNum">       4 </span>            : // MS compatible compilers support #pragma once
<span class="lineNum">       5 </span>            : 
<span class="lineNum">       6 </span>            : #if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1020)
<span class="lineNum">       7 </span>            : # pragma once
<span class="lineNum">       8 </span>            : #endif
<span class="lineNum">       9 </span>            : 
<span class="lineNum">      10 </span>            : //
<span class="lineNum">      11 </span>            : //  detail/shared_count.hpp
<span class="lineNum">      12 </span>            : //
<span class="lineNum">      13 </span>            : //  Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
<span class="lineNum">      14 </span>            : //  Copyright 2004-2005 Peter Dimov
<span class="lineNum">      15 </span>            : //
<span class="lineNum">      16 </span>            : // Distributed under the Boost Software License, Version 1.0. (See
<span class="lineNum">      17 </span>            : // accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">      18 </span>            : // http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">      19 </span>            : //
<span class="lineNum">      20 </span>            : 
<span class="lineNum">      21 </span>            : #ifdef __BORLANDC__
<span class="lineNum">      22 </span>            : # pragma warn -8027     // Functions containing try are not expanded inline
<span class="lineNum">      23 </span>            : #endif
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span>            : #include &lt;boost/config.hpp&gt;
<span class="lineNum">      26 </span>            : #include &lt;boost/checked_delete.hpp&gt;
<span class="lineNum">      27 </span>            : #include &lt;boost/throw_exception.hpp&gt;
<span class="lineNum">      28 </span>            : #include &lt;boost/smart_ptr/bad_weak_ptr.hpp&gt;
<span class="lineNum">      29 </span>            : #include &lt;boost/smart_ptr/detail/sp_counted_base.hpp&gt;
<span class="lineNum">      30 </span>            : #include &lt;boost/smart_ptr/detail/sp_counted_impl.hpp&gt;
<span class="lineNum">      31 </span>            : #include &lt;boost/detail/workaround.hpp&gt;
<span class="lineNum">      32 </span>            : // In order to avoid circular dependencies with Boost.TR1
<span class="lineNum">      33 </span>            : // we make sure that our include of &lt;memory&gt; doesn't try to
<span class="lineNum">      34 </span>            : // pull in the TR1 headers: that's why we use this header 
<span class="lineNum">      35 </span>            : // rather than including &lt;memory&gt; directly:
<span class="lineNum">      36 </span>            : #include &lt;boost/config/no_tr1/memory.hpp&gt;  // std::auto_ptr
<span class="lineNum">      37 </span>            : #include &lt;functional&gt;       // std::less
<span class="lineNum">      38 </span>            : 
<span class="lineNum">      39 </span>            : #ifdef BOOST_NO_EXCEPTIONS
<span class="lineNum">      40 </span>            : # include &lt;new&gt;              // std::bad_alloc
<span class="lineNum">      41 </span>            : #endif
<span class="lineNum">      42 </span>            : 
<span class="lineNum">      43 </span>            : #if !defined( BOOST_NO_CXX11_SMART_PTR )
<span class="lineNum">      44 </span>            : # include &lt;boost/utility/addressof.hpp&gt;
<span class="lineNum">      45 </span>            : #endif
<span class="lineNum">      46 </span>            : 
<span class="lineNum">      47 </span>            : namespace boost
<span class="lineNum">      48 </span>            : {
<span class="lineNum">      49 </span>            : 
<span class="lineNum">      50 </span>            : namespace detail
<span class="lineNum">      51 </span>            : {
<span class="lineNum">      52 </span>            : 
<span class="lineNum">      53 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">      54 </span>            : 
<span class="lineNum">      55 </span>            : int const shared_count_id = 0x2C35F101;
<span class="lineNum">      56 </span>            : int const   weak_count_id = 0x298C38A4;
<span class="lineNum">      57 </span>            : 
<span class="lineNum">      58 </span>            : #endif
<span class="lineNum">      59 </span>            : 
<span class="lineNum">      60 </span>            : struct sp_nothrow_tag {};
<span class="lineNum">      61 </span>            : 
<span class="lineNum">      62 </span>            : template&lt; class D &gt; struct sp_inplace_tag
<span class="lineNum">      63 </span>            : {
<span class="lineNum">      64 </span>            : };
<span class="lineNum">      65 </span>            : 
<span class="lineNum">      66 </span>            : #if !defined( BOOST_NO_CXX11_SMART_PTR )
<span class="lineNum">      67 </span>            : 
<span class="lineNum">      68 </span>            : template&lt; class T &gt; class sp_reference_wrapper
<span class="lineNum">      69 </span>            : { 
<span class="lineNum">      70 </span>            : public:
<span class="lineNum">      71 </span>            : 
<span class="lineNum">      72 </span>            :     explicit sp_reference_wrapper( T &amp; t): t_( boost::addressof( t ) )
<span class="lineNum">      73 </span>            :     {
<span class="lineNum">      74 </span>            :     }
<span class="lineNum">      75 </span>            : 
<span class="lineNum">      76 </span>            :     template&lt; class Y &gt; void operator()( Y * p ) const
<span class="lineNum">      77 </span>            :     {
<span class="lineNum">      78 </span>            :         (*t_)( p );
<span class="lineNum">      79 </span>            :     }
<span class="lineNum">      80 </span>            : 
<span class="lineNum">      81 </span>            : private:
<span class="lineNum">      82 </span>            : 
<span class="lineNum">      83 </span>            :     T * t_;
<span class="lineNum">      84 </span>            : };
<span class="lineNum">      85 </span>            : 
<span class="lineNum">      86 </span>            : template&lt; class D &gt; struct sp_convert_reference
<span class="lineNum">      87 </span>            : {
<span class="lineNum">      88 </span>            :     typedef D type;
<span class="lineNum">      89 </span>            : };
<span class="lineNum">      90 </span>            : 
<span class="lineNum">      91 </span>            : template&lt; class D &gt; struct sp_convert_reference&lt; D&amp; &gt;
<span class="lineNum">      92 </span>            : {
<span class="lineNum">      93 </span>            :     typedef sp_reference_wrapper&lt; D &gt; type;
<span class="lineNum">      94 </span>            : };
<span class="lineNum">      95 </span>            : 
<span class="lineNum">      96 </span>            : #endif
<span class="lineNum">      97 </span>            : 
<span class="lineNum">      98 </span>            : class weak_count;
<span class="lineNum">      99 </span>            : 
<span class="lineNum">     100 </span>            : class shared_count
<span class="lineNum">     101 </span>            : {
<span class="lineNum">     102 </span>            : private:
<span class="lineNum">     103 </span>            : 
<span class="lineNum">     104 </span>            :     sp_counted_base * pi_;
<span class="lineNum">     105 </span>            : 
<span class="lineNum">     106 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     107 </span>            :     int id_;
<span class="lineNum">     108 </span>            : #endif
<span class="lineNum">     109 </span>            : 
<span class="lineNum">     110 </span>            :     friend class weak_count;
<span class="lineNum">     111 </span>            : 
<span class="lineNum">     112 </span>            : public:
<span class="lineNum">     113 </span>            : 
<span class="lineNum">     114 </span><span class="lineCov">        950 :     shared_count(): pi_(0) // nothrow</span>
<span class="lineNum">     115 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     116 </span>            :         , id_(shared_count_id)
<span class="lineNum">     117 </span>            : #endif
<span class="lineNum">     118 </span>            :     {
<a name="119"><span class="lineNum">     119 </span>            :     }</a>
<span class="lineNum">     120 </span>            : 
<span class="lineNum">     121 </span><span class="lineCov">        530 :     template&lt;class Y&gt; explicit shared_count( Y * p ): pi_( 0 )</span>
<span class="lineNum">     122 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     123 </span>            :         , id_(shared_count_id)
<span class="lineNum">     124 </span>            : #endif
<span class="lineNum">     125 </span>            :     {
<span class="lineNum">     126 </span>            : #ifndef BOOST_NO_EXCEPTIONS
<span class="lineNum">     127 </span>            : 
<span class="lineNum">     128 </span>            :         try
<span class="lineNum">     129 </span>            :         {
<span class="lineNum">     130 </span><span class="lineCov">       1060 :             pi_ = new sp_counted_impl_p&lt;Y&gt;( p );</span>
<span class="lineNum">     131 </span>            :         }
<span class="lineNum">     132 </span><span class="lineNoCov">          0 :         catch(...)</span>
<span class="lineNum">     133 </span>            :         {
<span class="lineNum">     134 </span><span class="lineNoCov">          0 :             boost::checked_delete( p );</span>
<span class="lineNum">     135 </span><span class="lineNoCov">          0 :             throw;</span>
<span class="lineNum">     136 </span>            :         }
<span class="lineNum">     137 </span>            : 
<span class="lineNum">     138 </span>            : #else
<span class="lineNum">     139 </span>            : 
<span class="lineNum">     140 </span>            :         pi_ = new sp_counted_impl_p&lt;Y&gt;( p );
<span class="lineNum">     141 </span>            : 
<span class="lineNum">     142 </span>            :         if( pi_ == 0 )
<span class="lineNum">     143 </span>            :         {
<span class="lineNum">     144 </span>            :             boost::checked_delete( p );
<span class="lineNum">     145 </span>            :             boost::throw_exception( std::bad_alloc() );
<span class="lineNum">     146 </span>            :         }
<span class="lineNum">     147 </span>            : 
<span class="lineNum">     148 </span>            : #endif
<span class="lineNum">     149 </span><span class="lineCov">        530 :     }</span>
<span class="lineNum">     150 </span>            : 
<span class="lineNum">     151 </span>            : #if defined( BOOST_MSVC ) &amp;&amp; BOOST_WORKAROUND( BOOST_MSVC, &lt;= 1200 )
<a name="152"><span class="lineNum">     152 </span>            :     template&lt;class Y, class D&gt; shared_count( Y * p, D d ): pi_(0)</a>
<span class="lineNum">     153 </span>            : #else
<span class="lineNum">     154 </span><span class="lineCov">          1 :     template&lt;class P, class D&gt; shared_count( P p, D d ): pi_(0)</span>
<span class="lineNum">     155 </span>            : #endif
<span class="lineNum">     156 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     157 </span>            :         , id_(shared_count_id)
<span class="lineNum">     158 </span>            : #endif
<span class="lineNum">     159 </span>            :     {
<span class="lineNum">     160 </span>            : #if defined( BOOST_MSVC ) &amp;&amp; BOOST_WORKAROUND( BOOST_MSVC, &lt;= 1200 )
<span class="lineNum">     161 </span>            :         typedef Y* P;
<span class="lineNum">     162 </span>            : #endif
<span class="lineNum">     163 </span>            : #ifndef BOOST_NO_EXCEPTIONS
<span class="lineNum">     164 </span>            : 
<span class="lineNum">     165 </span>            :         try
<span class="lineNum">     166 </span>            :         {
<span class="lineNum">     167 </span><span class="lineCov">          2 :             pi_ = new sp_counted_impl_pd&lt;P, D&gt;(p, d);</span>
<span class="lineNum">     168 </span>            :         }
<span class="lineNum">     169 </span><span class="lineNoCov">          0 :         catch(...)</span>
<span class="lineNum">     170 </span>            :         {
<span class="lineNum">     171 </span>            :             d(p); // delete p
<span class="lineNum">     172 </span><span class="lineNoCov">          0 :             throw;</span>
<span class="lineNum">     173 </span>            :         }
<span class="lineNum">     174 </span>            : 
<span class="lineNum">     175 </span>            : #else
<span class="lineNum">     176 </span>            : 
<span class="lineNum">     177 </span>            :         pi_ = new sp_counted_impl_pd&lt;P, D&gt;(p, d);
<span class="lineNum">     178 </span>            : 
<span class="lineNum">     179 </span>            :         if(pi_ == 0)
<span class="lineNum">     180 </span>            :         {
<span class="lineNum">     181 </span>            :             d(p); // delete p
<span class="lineNum">     182 </span>            :             boost::throw_exception(std::bad_alloc());
<span class="lineNum">     183 </span>            :         }
<span class="lineNum">     184 </span>            : 
<span class="lineNum">     185 </span>            : #endif
<span class="lineNum">     186 </span><span class="lineCov">          1 :     }</span>
<span class="lineNum">     187 </span>            : 
<span class="lineNum">     188 </span>            : #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
<span class="lineNum">     189 </span>            : 
<span class="lineNum">     190 </span>            :     template&lt; class P, class D &gt; shared_count( P p, sp_inplace_tag&lt;D&gt; ): pi_( 0 )
<span class="lineNum">     191 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     192 </span>            :         , id_(shared_count_id)
<span class="lineNum">     193 </span>            : #endif
<span class="lineNum">     194 </span>            :     {
<span class="lineNum">     195 </span>            : #ifndef BOOST_NO_EXCEPTIONS
<span class="lineNum">     196 </span>            : 
<span class="lineNum">     197 </span>            :         try
<span class="lineNum">     198 </span>            :         {
<span class="lineNum">     199 </span>            :             pi_ = new sp_counted_impl_pd&lt; P, D &gt;( p );
<span class="lineNum">     200 </span>            :         }
<span class="lineNum">     201 </span>            :         catch( ... )
<span class="lineNum">     202 </span>            :         {
<span class="lineNum">     203 </span>            :             D::operator_fn( p ); // delete p
<span class="lineNum">     204 </span>            :             throw;
<span class="lineNum">     205 </span>            :         }
<span class="lineNum">     206 </span>            : 
<span class="lineNum">     207 </span>            : #else
<span class="lineNum">     208 </span>            : 
<span class="lineNum">     209 </span>            :         pi_ = new sp_counted_impl_pd&lt; P, D &gt;( p );
<span class="lineNum">     210 </span>            : 
<span class="lineNum">     211 </span>            :         if( pi_ == 0 )
<span class="lineNum">     212 </span>            :         {
<span class="lineNum">     213 </span>            :             D::operator_fn( p ); // delete p
<span class="lineNum">     214 </span>            :             boost::throw_exception( std::bad_alloc() );
<span class="lineNum">     215 </span>            :         }
<span class="lineNum">     216 </span>            : 
<span class="lineNum">     217 </span>            : #endif // #ifndef BOOST_NO_EXCEPTIONS
<span class="lineNum">     218 </span>            :     }
<span class="lineNum">     219 </span>            : 
<span class="lineNum">     220 </span>            : #endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
<span class="lineNum">     221 </span>            : 
<span class="lineNum">     222 </span>            :     template&lt;class P, class D, class A&gt; shared_count( P p, D d, A a ): pi_( 0 )
<span class="lineNum">     223 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     224 </span>            :         , id_(shared_count_id)
<span class="lineNum">     225 </span>            : #endif
<span class="lineNum">     226 </span>            :     {
<span class="lineNum">     227 </span>            :         typedef sp_counted_impl_pda&lt;P, D, A&gt; impl_type;
<span class="lineNum">     228 </span>            : 
<span class="lineNum">     229 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     230 </span>            : 
<span class="lineNum">     231 </span>            :         typedef typename std::allocator_traits&lt;A&gt;::template rebind_alloc&lt; impl_type &gt; A2;
<span class="lineNum">     232 </span>            : 
<span class="lineNum">     233 </span>            : #else
<span class="lineNum">     234 </span>            : 
<span class="lineNum">     235 </span>            :         typedef typename A::template rebind&lt; impl_type &gt;::other A2;
<span class="lineNum">     236 </span>            : 
<span class="lineNum">     237 </span>            : #endif
<span class="lineNum">     238 </span>            : 
<span class="lineNum">     239 </span>            :         A2 a2( a );
<span class="lineNum">     240 </span>            : 
<span class="lineNum">     241 </span>            : #ifndef BOOST_NO_EXCEPTIONS
<span class="lineNum">     242 </span>            : 
<span class="lineNum">     243 </span>            :         try
<span class="lineNum">     244 </span>            :         {
<span class="lineNum">     245 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     246 </span>            : 
<span class="lineNum">     247 </span>            :             impl_type * pi = std::allocator_traits&lt;A2&gt;::allocate( a2, 1 );
<span class="lineNum">     248 </span>            :             pi_ = pi;
<span class="lineNum">     249 </span>            :             std::allocator_traits&lt;A2&gt;::construct( a2, pi, p, d, a );
<span class="lineNum">     250 </span>            : 
<span class="lineNum">     251 </span>            : #else
<span class="lineNum">     252 </span>            : 
<span class="lineNum">     253 </span>            :             pi_ = a2.allocate( 1, static_cast&lt; impl_type* &gt;( 0 ) );
<span class="lineNum">     254 </span>            :             ::new( static_cast&lt; void* &gt;( pi_ ) ) impl_type( p, d, a );
<span class="lineNum">     255 </span>            : 
<span class="lineNum">     256 </span>            : #endif
<span class="lineNum">     257 </span>            :         }
<span class="lineNum">     258 </span>            :         catch(...)
<span class="lineNum">     259 </span>            :         {
<span class="lineNum">     260 </span>            :             d( p );
<span class="lineNum">     261 </span>            : 
<span class="lineNum">     262 </span>            :             if( pi_ != 0 )
<span class="lineNum">     263 </span>            :             {
<span class="lineNum">     264 </span>            :                 a2.deallocate( static_cast&lt; impl_type* &gt;( pi_ ), 1 );
<span class="lineNum">     265 </span>            :             }
<span class="lineNum">     266 </span>            : 
<span class="lineNum">     267 </span>            :             throw;
<span class="lineNum">     268 </span>            :         }
<span class="lineNum">     269 </span>            : 
<span class="lineNum">     270 </span>            : #else
<span class="lineNum">     271 </span>            : 
<span class="lineNum">     272 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     273 </span>            : 
<span class="lineNum">     274 </span>            :         impl_type * pi = std::allocator_traits&lt;A2&gt;::allocate( a2, 1 );
<span class="lineNum">     275 </span>            :         pi_ = pi;
<span class="lineNum">     276 </span>            : 
<span class="lineNum">     277 </span>            : #else
<span class="lineNum">     278 </span>            : 
<span class="lineNum">     279 </span>            :         pi_ = a2.allocate( 1, static_cast&lt; impl_type* &gt;( 0 ) );
<span class="lineNum">     280 </span>            : 
<span class="lineNum">     281 </span>            : #endif
<span class="lineNum">     282 </span>            : 
<span class="lineNum">     283 </span>            :         if( pi_ != 0 )
<span class="lineNum">     284 </span>            :         {
<span class="lineNum">     285 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     286 </span>            : 
<span class="lineNum">     287 </span>            :             std::allocator_traits&lt;A2&gt;::construct( a2, pi, p, d, a );
<span class="lineNum">     288 </span>            : 
<span class="lineNum">     289 </span>            : #else
<span class="lineNum">     290 </span>            : 
<span class="lineNum">     291 </span>            :             ::new( static_cast&lt; void* &gt;( pi_ ) ) impl_type( p, d, a );
<span class="lineNum">     292 </span>            : 
<span class="lineNum">     293 </span>            : #endif
<span class="lineNum">     294 </span>            :         }
<span class="lineNum">     295 </span>            :         else
<span class="lineNum">     296 </span>            :         {
<span class="lineNum">     297 </span>            :             d( p );
<span class="lineNum">     298 </span>            :             boost::throw_exception( std::bad_alloc() );
<span class="lineNum">     299 </span>            :         }
<span class="lineNum">     300 </span>            : 
<span class="lineNum">     301 </span>            : #endif
<span class="lineNum">     302 </span>            :     }
<span class="lineNum">     303 </span>            : 
<span class="lineNum">     304 </span>            : #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
<span class="lineNum">     305 </span>            : 
<span class="lineNum">     306 </span>            :     template&lt; class P, class D, class A &gt; shared_count( P p, sp_inplace_tag&lt; D &gt;, A a ): pi_( 0 )
<span class="lineNum">     307 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     308 </span>            :         , id_(shared_count_id)
<span class="lineNum">     309 </span>            : #endif
<span class="lineNum">     310 </span>            :     {
<span class="lineNum">     311 </span>            :         typedef sp_counted_impl_pda&lt; P, D, A &gt; impl_type;
<span class="lineNum">     312 </span>            : 
<span class="lineNum">     313 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     314 </span>            : 
<span class="lineNum">     315 </span>            :         typedef typename std::allocator_traits&lt;A&gt;::template rebind_alloc&lt; impl_type &gt; A2;
<span class="lineNum">     316 </span>            : 
<span class="lineNum">     317 </span>            : #else
<span class="lineNum">     318 </span>            : 
<span class="lineNum">     319 </span>            :         typedef typename A::template rebind&lt; impl_type &gt;::other A2;
<span class="lineNum">     320 </span>            : 
<span class="lineNum">     321 </span>            : #endif
<span class="lineNum">     322 </span>            : 
<span class="lineNum">     323 </span>            :         A2 a2( a );
<span class="lineNum">     324 </span>            : 
<span class="lineNum">     325 </span>            : #ifndef BOOST_NO_EXCEPTIONS
<span class="lineNum">     326 </span>            : 
<span class="lineNum">     327 </span>            :         try
<span class="lineNum">     328 </span>            :         {
<span class="lineNum">     329 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     330 </span>            : 
<span class="lineNum">     331 </span>            :             impl_type * pi = std::allocator_traits&lt;A2&gt;::allocate( a2, 1 );
<span class="lineNum">     332 </span>            :             pi_ = pi;
<span class="lineNum">     333 </span>            :             std::allocator_traits&lt;A2&gt;::construct( a2, pi, p, a );
<span class="lineNum">     334 </span>            : 
<span class="lineNum">     335 </span>            : #else
<span class="lineNum">     336 </span>            : 
<span class="lineNum">     337 </span>            :             pi_ = a2.allocate( 1, static_cast&lt; impl_type* &gt;( 0 ) );
<span class="lineNum">     338 </span>            :             ::new( static_cast&lt; void* &gt;( pi_ ) ) impl_type( p, a );
<span class="lineNum">     339 </span>            : 
<span class="lineNum">     340 </span>            : #endif
<span class="lineNum">     341 </span>            :         }
<span class="lineNum">     342 </span>            :         catch(...)
<span class="lineNum">     343 </span>            :         {
<span class="lineNum">     344 </span>            :             D::operator_fn( p );
<span class="lineNum">     345 </span>            : 
<span class="lineNum">     346 </span>            :             if( pi_ != 0 )
<span class="lineNum">     347 </span>            :             {
<span class="lineNum">     348 </span>            :                 a2.deallocate( static_cast&lt; impl_type* &gt;( pi_ ), 1 );
<span class="lineNum">     349 </span>            :             }
<span class="lineNum">     350 </span>            : 
<span class="lineNum">     351 </span>            :             throw;
<span class="lineNum">     352 </span>            :         }
<span class="lineNum">     353 </span>            : 
<span class="lineNum">     354 </span>            : #else
<span class="lineNum">     355 </span>            : 
<span class="lineNum">     356 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     357 </span>            : 
<span class="lineNum">     358 </span>            :         impl_type * pi = std::allocator_traits&lt;A2&gt;::allocate( a2, 1 );
<span class="lineNum">     359 </span>            :         pi_ = pi;
<span class="lineNum">     360 </span>            : 
<span class="lineNum">     361 </span>            : #else
<span class="lineNum">     362 </span>            : 
<span class="lineNum">     363 </span>            :         pi_ = a2.allocate( 1, static_cast&lt; impl_type* &gt;( 0 ) );
<span class="lineNum">     364 </span>            : 
<span class="lineNum">     365 </span>            : #endif
<span class="lineNum">     366 </span>            : 
<span class="lineNum">     367 </span>            :         if( pi_ != 0 )
<span class="lineNum">     368 </span>            :         {
<span class="lineNum">     369 </span>            : #if !defined( BOOST_NO_CXX11_ALLOCATOR )
<span class="lineNum">     370 </span>            : 
<span class="lineNum">     371 </span>            :             std::allocator_traits&lt;A2&gt;::construct( a2, pi, p, a );
<span class="lineNum">     372 </span>            : 
<span class="lineNum">     373 </span>            : #else
<span class="lineNum">     374 </span>            : 
<span class="lineNum">     375 </span>            :             ::new( static_cast&lt; void* &gt;( pi_ ) ) impl_type( p, a );
<span class="lineNum">     376 </span>            : 
<span class="lineNum">     377 </span>            : #endif
<span class="lineNum">     378 </span>            :         }
<span class="lineNum">     379 </span>            :         else
<span class="lineNum">     380 </span>            :         {
<span class="lineNum">     381 </span>            :             D::operator_fn( p );
<span class="lineNum">     382 </span>            :             boost::throw_exception( std::bad_alloc() );
<span class="lineNum">     383 </span>            :         }
<span class="lineNum">     384 </span>            : 
<span class="lineNum">     385 </span>            : #endif // #ifndef BOOST_NO_EXCEPTIONS
<span class="lineNum">     386 </span>            :     }
<span class="lineNum">     387 </span>            : 
<span class="lineNum">     388 </span>            : #endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
<span class="lineNum">     389 </span>            : 
<span class="lineNum">     390 </span>            : #ifndef BOOST_NO_AUTO_PTR
<span class="lineNum">     391 </span>            : 
<span class="lineNum">     392 </span>            :     // auto_ptr&lt;Y&gt; is special cased to provide the strong guarantee
<span class="lineNum">     393 </span>            : 
<span class="lineNum">     394 </span>            :     template&lt;class Y&gt;
<span class="lineNum">     395 </span>            :     explicit shared_count( std::auto_ptr&lt;Y&gt; &amp; r ): pi_( new sp_counted_impl_p&lt;Y&gt;( r.get() ) )
<span class="lineNum">     396 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     397 </span>            :         , id_(shared_count_id)
<span class="lineNum">     398 </span>            : #endif
<span class="lineNum">     399 </span>            :     {
<span class="lineNum">     400 </span>            : #ifdef BOOST_NO_EXCEPTIONS
<span class="lineNum">     401 </span>            : 
<span class="lineNum">     402 </span>            :         if( pi_ == 0 )
<span class="lineNum">     403 </span>            :         {
<span class="lineNum">     404 </span>            :             boost::throw_exception(std::bad_alloc());
<span class="lineNum">     405 </span>            :         }
<span class="lineNum">     406 </span>            : 
<span class="lineNum">     407 </span>            : #endif
<span class="lineNum">     408 </span>            : 
<span class="lineNum">     409 </span>            :         r.release();
<span class="lineNum">     410 </span>            :     }
<span class="lineNum">     411 </span>            : 
<span class="lineNum">     412 </span>            : #endif 
<span class="lineNum">     413 </span>            : 
<span class="lineNum">     414 </span>            : #if !defined( BOOST_NO_CXX11_SMART_PTR )
<span class="lineNum">     415 </span>            : 
<span class="lineNum">     416 </span>            :     template&lt;class Y, class D&gt;
<span class="lineNum">     417 </span>            :     explicit shared_count( std::unique_ptr&lt;Y, D&gt; &amp; r ): pi_( 0 )
<span class="lineNum">     418 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     419 </span>            :         , id_(shared_count_id)
<span class="lineNum">     420 </span>            : #endif
<span class="lineNum">     421 </span>            :     {
<span class="lineNum">     422 </span>            :         typedef typename sp_convert_reference&lt;D&gt;::type D2;
<span class="lineNum">     423 </span>            : 
<span class="lineNum">     424 </span>            :         D2 d2( r.get_deleter() );
<span class="lineNum">     425 </span>            :         pi_ = new sp_counted_impl_pd&lt; typename std::unique_ptr&lt;Y, D&gt;::pointer, D2 &gt;( r.get(), d2 );
<span class="lineNum">     426 </span>            : 
<span class="lineNum">     427 </span>            : #ifdef BOOST_NO_EXCEPTIONS
<span class="lineNum">     428 </span>            : 
<span class="lineNum">     429 </span>            :         if( pi_ == 0 )
<span class="lineNum">     430 </span>            :         {
<span class="lineNum">     431 </span>            :             boost::throw_exception( std::bad_alloc() );
<span class="lineNum">     432 </span>            :         }
<span class="lineNum">     433 </span>            : 
<span class="lineNum">     434 </span>            : #endif
<span class="lineNum">     435 </span>            : 
<span class="lineNum">     436 </span>            :         r.release();
<span class="lineNum">     437 </span>            :     }
<span class="lineNum">     438 </span>            : 
<span class="lineNum">     439 </span>            : #endif
<span class="lineNum">     440 </span>            : 
<span class="lineNum">     441 </span>            :     ~shared_count() // nothrow
<span class="lineNum">     442 </span><span class="lineCov">       1688 :     {</span>
<span class="lineNum">     443 </span><span class="lineCov">      10262 :         if( pi_ != 0 ) pi_-&gt;release();</span>
<span class="lineNum">     444 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     445 </span>            :         id_ = 0;
<span class="lineNum">     446 </span>            : #endif
<span class="lineNum">     447 </span>            :     }
<span class="lineNum">     448 </span>            : 
<span class="lineNum">     449 </span><span class="lineCov">       8779 :     shared_count(shared_count const &amp; r): pi_(r.pi_) // nothrow</span>
<span class="lineNum">     450 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     451 </span>            :         , id_(shared_count_id)
<span class="lineNum">     452 </span>            : #endif
<span class="lineNum">     453 </span>            :     {
<span class="lineNum">     454 </span><span class="lineCov">       8779 :         if( pi_ != 0 ) pi_-&gt;add_ref_copy();</span>
<span class="lineNum">     455 </span>            :     }
<span class="lineNum">     456 </span>            : 
<span class="lineNum">     457 </span>            : #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
<span class="lineNum">     458 </span>            : 
<span class="lineNum">     459 </span>            :     shared_count(shared_count &amp;&amp; r): pi_(r.pi_) // nothrow
<span class="lineNum">     460 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     461 </span>            :         , id_(shared_count_id)
<span class="lineNum">     462 </span>            : #endif
<span class="lineNum">     463 </span>            :     {
<span class="lineNum">     464 </span>            :         r.pi_ = 0;
<span class="lineNum">     465 </span>            :     }
<span class="lineNum">     466 </span>            : 
<span class="lineNum">     467 </span>            : #endif
<span class="lineNum">     468 </span>            : 
<span class="lineNum">     469 </span>            :     explicit shared_count(weak_count const &amp; r); // throws bad_weak_ptr when r.use_count() == 0
<span class="lineNum">     470 </span>            :     shared_count( weak_count const &amp; r, sp_nothrow_tag ); // constructs an empty *this when r.use_count() == 0
<span class="lineNum">     471 </span>            : 
<span class="lineNum">     472 </span>            :     shared_count &amp; operator= (shared_count const &amp; r) // nothrow
<span class="lineNum">     473 </span>            :     {
<span class="lineNum">     474 </span>            :         sp_counted_base * tmp = r.pi_;
<span class="lineNum">     475 </span>            : 
<span class="lineNum">     476 </span>            :         if( tmp != pi_ )
<span class="lineNum">     477 </span>            :         {
<span class="lineNum">     478 </span>            :             if( tmp != 0 ) tmp-&gt;add_ref_copy();
<span class="lineNum">     479 </span>            :             if( pi_ != 0 ) pi_-&gt;release();
<span class="lineNum">     480 </span>            :             pi_ = tmp;
<span class="lineNum">     481 </span>            :         }
<span class="lineNum">     482 </span>            : 
<span class="lineNum">     483 </span>            :         return *this;
<span class="lineNum">     484 </span>            :     }
<span class="lineNum">     485 </span>            : 
<span class="lineNum">     486 </span>            :     void swap(shared_count &amp; r) // nothrow
<span class="lineNum">     487 </span>            :     {
<span class="lineNum">     488 </span><span class="lineCov">       9510 :         sp_counted_base * tmp = r.pi_;</span>
<span class="lineNum">     489 </span><span class="lineCov">       9510 :         r.pi_ = pi_;</span>
<span class="lineNum">     490 </span><span class="lineCov">        936 :         pi_ = tmp;</span>
<span class="lineNum">     491 </span>            :     }
<span class="lineNum">     492 </span>            : 
<span class="lineNum">     493 </span>            :     long use_count() const // nothrow
<span class="lineNum">     494 </span>            :     {
<span class="lineNum">     495 </span>            :         return pi_ != 0? pi_-&gt;use_count(): 0;
<span class="lineNum">     496 </span>            :     }
<span class="lineNum">     497 </span>            : 
<span class="lineNum">     498 </span>            :     bool unique() const // nothrow
<span class="lineNum">     499 </span>            :     {
<span class="lineNum">     500 </span>            :         return use_count() == 1;
<span class="lineNum">     501 </span>            :     }
<span class="lineNum">     502 </span>            : 
<span class="lineNum">     503 </span>            :     bool empty() const // nothrow
<span class="lineNum">     504 </span>            :     {
<span class="lineNum">     505 </span>            :         return pi_ == 0;
<span class="lineNum">     506 </span>            :     }
<span class="lineNum">     507 </span>            : 
<span class="lineNum">     508 </span>            :     friend inline bool operator==(shared_count const &amp; a, shared_count const &amp; b)
<span class="lineNum">     509 </span>            :     {
<span class="lineNum">     510 </span>            :         return a.pi_ == b.pi_;
<span class="lineNum">     511 </span>            :     }
<span class="lineNum">     512 </span>            : 
<span class="lineNum">     513 </span>            :     friend inline bool operator&lt;(shared_count const &amp; a, shared_count const &amp; b)
<span class="lineNum">     514 </span>            :     {
<span class="lineNum">     515 </span>            :         return std::less&lt;sp_counted_base *&gt;()( a.pi_, b.pi_ );
<span class="lineNum">     516 </span>            :     }
<span class="lineNum">     517 </span>            : 
<span class="lineNum">     518 </span>            :     void * get_deleter( sp_typeinfo const &amp; ti ) const
<span class="lineNum">     519 </span>            :     {
<span class="lineNum">     520 </span>            :         return pi_? pi_-&gt;get_deleter( ti ): 0;
<span class="lineNum">     521 </span>            :     }
<span class="lineNum">     522 </span>            : 
<span class="lineNum">     523 </span>            :     void * get_untyped_deleter() const
<span class="lineNum">     524 </span>            :     {
<span class="lineNum">     525 </span>            :         return pi_? pi_-&gt;get_untyped_deleter(): 0;
<span class="lineNum">     526 </span>            :     }
<span class="lineNum">     527 </span>            : };
<span class="lineNum">     528 </span>            : 
<span class="lineNum">     529 </span>            : 
<span class="lineNum">     530 </span>            : class weak_count
<span class="lineNum">     531 </span>            : {
<span class="lineNum">     532 </span>            : private:
<span class="lineNum">     533 </span>            : 
<span class="lineNum">     534 </span>            :     sp_counted_base * pi_;
<span class="lineNum">     535 </span>            : 
<span class="lineNum">     536 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     537 </span>            :     int id_;
<span class="lineNum">     538 </span>            : #endif
<span class="lineNum">     539 </span>            : 
<span class="lineNum">     540 </span>            :     friend class shared_count;
<span class="lineNum">     541 </span>            : 
<span class="lineNum">     542 </span>            : public:
<span class="lineNum">     543 </span>            : 
<span class="lineNum">     544 </span><span class="lineCov">          2 :     weak_count(): pi_(0) // nothrow</span>
<span class="lineNum">     545 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     546 </span>            :         , id_(weak_count_id)
<span class="lineNum">     547 </span>            : #endif
<span class="lineNum">     548 </span>            :     {
<span class="lineNum">     549 </span>            :     }
<span class="lineNum">     550 </span>            : 
<span class="lineNum">     551 </span>            :     weak_count(shared_count const &amp; r): pi_(r.pi_) // nothrow
<span class="lineNum">     552 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     553 </span>            :         , id_(weak_count_id)
<span class="lineNum">     554 </span>            : #endif
<span class="lineNum">     555 </span>            :     {
<span class="lineNum">     556 </span>            :         if(pi_ != 0) pi_-&gt;weak_add_ref();
<span class="lineNum">     557 </span>            :     }
<span class="lineNum">     558 </span>            : 
<span class="lineNum">     559 </span>            :     weak_count(weak_count const &amp; r): pi_(r.pi_) // nothrow
<span class="lineNum">     560 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     561 </span>            :         , id_(weak_count_id)
<span class="lineNum">     562 </span>            : #endif
<span class="lineNum">     563 </span>            :     {
<span class="lineNum">     564 </span>            :         if(pi_ != 0) pi_-&gt;weak_add_ref();
<span class="lineNum">     565 </span>            :     }
<span class="lineNum">     566 </span>            : 
<span class="lineNum">     567 </span>            : // Move support
<span class="lineNum">     568 </span>            : 
<span class="lineNum">     569 </span>            : #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
<span class="lineNum">     570 </span>            : 
<span class="lineNum">     571 </span>            :     weak_count(weak_count &amp;&amp; r): pi_(r.pi_) // nothrow
<span class="lineNum">     572 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     573 </span>            :         , id_(weak_count_id)
<span class="lineNum">     574 </span>            : #endif
<span class="lineNum">     575 </span>            :     {
<span class="lineNum">     576 </span>            :         r.pi_ = 0;
<span class="lineNum">     577 </span>            :     }
<span class="lineNum">     578 </span>            : 
<span class="lineNum">     579 </span>            : #endif
<span class="lineNum">     580 </span>            : 
<span class="lineNum">     581 </span>            :     ~weak_count() // nothrow
<span class="lineNum">     582 </span><span class="lineNoCov">          0 :     {</span>
<span class="lineNum">     583 </span><span class="lineNoCov">          0 :         if(pi_ != 0) pi_-&gt;weak_release();</span>
<span class="lineNum">     584 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     585 </span>            :         id_ = 0;
<span class="lineNum">     586 </span>            : #endif
<a name="587"><span class="lineNum">     587 </span>            :     }</a>
<span class="lineNum">     588 </span>            : 
<span class="lineNum">     589 </span><span class="lineCov">          2 :     weak_count &amp; operator= (shared_count const &amp; r) // nothrow</span>
<span class="lineNum">     590 </span>            :     {
<span class="lineNum">     591 </span><span class="lineCov">          2 :         sp_counted_base * tmp = r.pi_;</span>
<span class="lineNum">     592 </span>            : 
<span class="lineNum">     593 </span><span class="lineCov">          2 :         if( tmp != pi_ )</span>
<span class="lineNum">     594 </span>            :         {
<span class="lineNum">     595 </span><span class="lineCov">          2 :             if(tmp != 0) tmp-&gt;weak_add_ref();</span>
<span class="lineNum">     596 </span><span class="lineCov">          2 :             if(pi_ != 0) pi_-&gt;weak_release();</span>
<span class="lineNum">     597 </span><span class="lineCov">          2 :             pi_ = tmp;</span>
<span class="lineNum">     598 </span>            :         }
<span class="lineNum">     599 </span>            : 
<span class="lineNum">     600 </span><span class="lineCov">          2 :         return *this;</span>
<span class="lineNum">     601 </span>            :     }
<span class="lineNum">     602 </span>            : 
<span class="lineNum">     603 </span>            :     weak_count &amp; operator= (weak_count const &amp; r) // nothrow
<span class="lineNum">     604 </span>            :     {
<span class="lineNum">     605 </span>            :         sp_counted_base * tmp = r.pi_;
<span class="lineNum">     606 </span>            : 
<span class="lineNum">     607 </span>            :         if( tmp != pi_ )
<span class="lineNum">     608 </span>            :         {
<span class="lineNum">     609 </span>            :             if(tmp != 0) tmp-&gt;weak_add_ref();
<span class="lineNum">     610 </span>            :             if(pi_ != 0) pi_-&gt;weak_release();
<span class="lineNum">     611 </span>            :             pi_ = tmp;
<span class="lineNum">     612 </span>            :         }
<span class="lineNum">     613 </span>            : 
<span class="lineNum">     614 </span>            :         return *this;
<span class="lineNum">     615 </span>            :     }
<span class="lineNum">     616 </span>            : 
<span class="lineNum">     617 </span>            :     void swap(weak_count &amp; r) // nothrow
<span class="lineNum">     618 </span>            :     {
<span class="lineNum">     619 </span>            :         sp_counted_base * tmp = r.pi_;
<span class="lineNum">     620 </span>            :         r.pi_ = pi_;
<span class="lineNum">     621 </span>            :         pi_ = tmp;
<span class="lineNum">     622 </span>            :     }
<span class="lineNum">     623 </span>            : 
<span class="lineNum">     624 </span>            :     long use_count() const // nothrow
<span class="lineNum">     625 </span>            :     {
<span class="lineNum">     626 </span><span class="lineCov">          2 :         return pi_ != 0? pi_-&gt;use_count(): 0;</span>
<span class="lineNum">     627 </span>            :     }
<span class="lineNum">     628 </span>            : 
<span class="lineNum">     629 </span>            :     bool empty() const // nothrow
<span class="lineNum">     630 </span>            :     {
<span class="lineNum">     631 </span>            :         return pi_ == 0;
<span class="lineNum">     632 </span>            :     }
<span class="lineNum">     633 </span>            : 
<span class="lineNum">     634 </span>            :     friend inline bool operator==(weak_count const &amp; a, weak_count const &amp; b)
<span class="lineNum">     635 </span>            :     {
<span class="lineNum">     636 </span>            :         return a.pi_ == b.pi_;
<span class="lineNum">     637 </span>            :     }
<span class="lineNum">     638 </span>            : 
<span class="lineNum">     639 </span>            :     friend inline bool operator&lt;(weak_count const &amp; a, weak_count const &amp; b)
<span class="lineNum">     640 </span>            :     {
<span class="lineNum">     641 </span>            :         return std::less&lt;sp_counted_base *&gt;()(a.pi_, b.pi_);
<span class="lineNum">     642 </span>            :     }
<a name="643"><span class="lineNum">     643 </span>            : };</a>
<span class="lineNum">     644 </span>            : 
<span class="lineNum">     645 </span><span class="lineNoCov">          0 : inline shared_count::shared_count( weak_count const &amp; r ): pi_( r.pi_ )</span>
<span class="lineNum">     646 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     647 </span>            :         , id_(shared_count_id)
<span class="lineNum">     648 </span>            : #endif
<span class="lineNum">     649 </span>            : {
<span class="lineNum">     650 </span><span class="lineNoCov">          0 :     if( pi_ == 0 || !pi_-&gt;add_ref_lock() )</span>
<span class="lineNum">     651 </span>            :     {
<span class="lineNum">     652 </span><span class="lineNoCov">          0 :         boost::throw_exception( boost::bad_weak_ptr() );</span>
<span class="lineNum">     653 </span>            :     }
<span class="lineNum">     654 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     655 </span>            : 
<span class="lineNum">     656 </span>            : inline shared_count::shared_count( weak_count const &amp; r, sp_nothrow_tag ): pi_( r.pi_ )
<span class="lineNum">     657 </span>            : #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
<span class="lineNum">     658 </span>            :         , id_(shared_count_id)
<span class="lineNum">     659 </span>            : #endif
<span class="lineNum">     660 </span>            : {
<span class="lineNum">     661 </span>            :     if( pi_ != 0 &amp;&amp; !pi_-&gt;add_ref_lock() )
<span class="lineNum">     662 </span>            :     {
<span class="lineNum">     663 </span>            :         pi_ = 0;
<span class="lineNum">     664 </span>            :     }
<span class="lineNum">     665 </span>            : }
<span class="lineNum">     666 </span>            : 
<span class="lineNum">     667 </span>            : } // namespace detail
<span class="lineNum">     668 </span>            : 
<span class="lineNum">     669 </span>            : } // namespace boost
<span class="lineNum">     670 </span>            : 
<span class="lineNum">     671 </span>            : #ifdef __BORLANDC__
<span class="lineNum">     672 </span>            : # pragma warn .8027     // Functions containing try are not expanded inline
<span class="lineNum">     673 </span>            : #endif
<span class="lineNum">     674 </span>            : 
<span class="lineNum">     675 </span>            : #endif  // #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
